Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support of Makefile and PHAR builds on local machines #77

Merged
merged 19 commits into from
May 13, 2024

Conversation

lotyp
Copy link
Member

@lotyp lotyp commented May 10, 2024

What was changed

Warning

This is a parent PR of the subsidiary PR: #79
These two pull requests should be merged together

Makefile

Changes:

  • Implemented Docker-based command encapsulation to streamline local development setups.
  • Simplified environment management and application operations through Docker Compose.

Rationale:

  • Provides a single point of entry to execute common commands, improving developer experience by standardizing project setup.
  • Facilitates the use of Docker to handle various PHP versions and essential development tools without local installation, promoting environment consistency. This includes managing dependencies and tools such as:
    • Actionlint: Helps in linting and validating GitHub Actions workflows to ensure they are error-free.
    • Yamllint: Ensures YAML files are syntactically correct and adhere to best practices.
    • Envsubst: A tool for substituting environment variables in shell formats.
    • Markdownlint: Assists in maintaining consistent markdown formatting according to defined rules.
    • Phive: A PHAR manager that simplifies installing and managing PHP tools distributed as PHAR files.
    • PHAR build: Builds PHP applications into a single PHAR (PHP Archive) file for easy distribution and deployment.
    • Composer dependency management: Manages PHP package dependencies, ensuring the project has all required libraries with specified versions.
  • Supports multi-architecture PHP Docker images: arm64 and amd64, ensuring compatibility across different development setups (MacOS, Linux) and minimizing configuration overhead.

.env and .env.example

Changes:

  • Introduced .env and .env.example files to better control Docker composition and debugging capabilities in local development environment.

Rationale:

  • Allows precise control over the Docker environment, aiding in project organization and debugging processes.
  • Enhances the reproducibility of bugs and testing scenarios across different environments, enabling developers to identify and address issues more quickly and easily without relying on GitHub Actions.

box.json.dist

Changes:

  • Configured settings for the Box application bundler to specify compaction, file inclusion, and output settings for building PHAR files.

Rationale:

  • Facilitates the packaging of the application into a single PHAR file, simplifying deployment and distribution. This allows developers to install the package as a PHAR archive using PHIVE, avoiding the need to include buggregator/trap as a dev composer dependency and preventing bloat in development requirements.
  • Closes Build PHAR #20

composer.json

Changes:

  • Standardized the formatting of the composer.json file using the composer-normalize tool.

Rationale

  • Enhances the maintainability and clarity of the composer.json file by ensuring it adheres to consistent formatting guidelines.

docker-compose.yaml

Changes:

    • Integrated the wayofdev/php-dev Docker image to provide developers with a ready-to-use solution, eliminating the need to install PHP and its extensions locally.

Rationale:

  • Enables quick switching between different PHP environments, enhancing testing across versions. This flexibility is supported by the availability of multiple tags, which can be found here:

    • 8.3-cli-alpine-latest
    • 8.2-cli-alpine-latest
    • 8.1-cli-alpine-latest

    These images are packaged as multi-arch, supporting both ARM architectures (suitable for macOS M1, M2, M3 series) and AMD64 (compatible with Intel and AMD x86-64 processors). This ensures a seamless development experience across various hardware platforms.

  • wayofdev/php-dev Docker images come equipped with built-in development tools and XDebug support, significantly reducing the setup time for developers. This integration enhances productivity and ensures a seamless integration with IDEs like PHPStorm, optimizing the development process.

phpunit.xml

Changes:

  • Updated PHPUnit configuration to centralize cache results and adjust execution settings, by using one single folder, for all development tools .build

@lotyp lotyp marked this pull request as draft May 10, 2024 14:41
lotyp added 3 commits May 10, 2024 19:04
…ates

* 'master' of github.com:buggregator/trap:
  chore: simplify version function
  fix: return experimental, if version is not found
  feat: use latest version from auto-incrementing file
Added base PHP image to run local development and PHAR builds

ci: added default markdownlint config

feat: add box-project/box, composer-require-checker and composer-normalize PHARs

feat: Makefile now builds trap PHAR locally using `make phar` command
@lotyp lotyp mentioned this pull request May 11, 2024
@lotyp lotyp changed the title fix: use .build directory for all development tools feat: support of Makefile and PHAR builds on local machines May 12, 2024
@lotyp lotyp mentioned this pull request May 12, 2024
@lotyp lotyp marked this pull request as ready for review May 12, 2024 16:06
@lotyp lotyp requested review from roxblnfk and butschster May 12, 2024 16:42
@lotyp lotyp merged commit 25eb86e into master May 13, 2024
20 checks passed
@lotyp lotyp deleted the feat/dx-updates branch May 13, 2024 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Build PHAR
2 participants